home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / g_quake / server~1.zip / _LEVSEL.QC < prev    next >
Text File  |  1996-10-04  |  7KB  |  169 lines

  1. /*
  2. **
  3. ** _levsel.qc (LevelSelect Code, 1.1)
  4. **
  5. ** Copyright (C) 1996 Johannes Plass
  6. ** 
  7. ** This program is free software; you can redistribute it and/or modify
  8. ** it under the terms of the GNU General Public License as published by
  9. ** the Free Software Foundation; either version 2 of the License, or
  10. ** (at your option) any later version.
  11. ** 
  12. ** This program is distributed in the hope that it will be useful,
  13. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15. ** GNU General Public License for more details.
  16. **
  17. ** You should have received a copy of the GNU General Public License
  18. ** along with this program; if not, write to the Free Software
  19. ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. ** 
  21. ** Author:   Johannes Plass (plass@dipmza.physik.uni-mainz.de)
  22. **
  23. */
  24.  
  25.  
  26. //==============================================================
  27. //   Defaults
  28. //==============================================================
  29.  
  30. // To provide your own list of levels which are to to be played
  31. // on your server please modify the function 'LevelSelectSelectLevel'
  32. // below. At the end of this function you will find some
  33. // examples which tell you how to do it.
  34.  
  35. //==============================================================
  36. //   LevelSelectInfo
  37. //==============================================================
  38.  
  39. void(entity player) LevelSelectInit =
  40. {
  41.   if (!USE_MODULE_LEVELSELECT) return;
  42.   // nothing to do
  43. };
  44.  
  45. //==============================================================
  46. //   LevelSelectInit
  47. //==============================================================
  48.  
  49. void(entity player) LevelSelectInfo =
  50. {
  51.   if (!USE_MODULE_LEVELSELECT) return;
  52.   // nothing to do
  53. };
  54.  
  55. //==============================================================
  56. //   LevelSelectActiveMessage
  57. //==============================================================
  58.  
  59. void(entity player) LevelSelectActiveMessage =
  60. {
  61.   if (!USE_MODULE_LEVELSELECT) return;
  62.               // 123456789#123456789#123456789#12345678
  63.   sprint(player,"  LevelSelect\n");
  64. };
  65.  
  66. //==============================================================
  67. //   LevelSelectSelectLevel
  68. //==============================================================
  69.  
  70. void() LevelSelectSelectLevel =
  71. {
  72.   if (!USE_MODULE_LEVELSELECT) return;
  73.  
  74.   // 'mapname' is the name of the level which just ended
  75.   // 'nextmap' is the name of the map quake proposes to be the next one
  76.  
  77.  
  78.   // DEATHMATCH LEVELS, END LEVEL
  79.   if      (                     nextmap == "end"  ) nextmap = "dm2"   ;
  80.   else if (mapname == "dm6"                       ) nextmap = "end"   ;
  81.   else if (mapname == "end"                       ) nextmap = "start" ;
  82.  
  83. };
  84.  
  85. /*
  86. ========================================================================
  87.    EXAMPLE 1
  88. ========================================================================
  89.  
  90.   Assume you only want to play the levels dm2, e1m2, e4m3 and e3m1
  91.   and exactly in this order. Then just paste the following lines
  92.   into the function 'LevelSelectSelectLevel' above:
  93.      if      (mapname == "dm2"                      ) nextmap = "e1m2" ;
  94.      else if (mapname == "e1m2"                     ) nextmap = "e4m3" ;
  95.      else if (mapname == "e4m3"                     ) nextmap = "e3m1" ;
  96.      else                                             nextmap = "dm2"  ;
  97.   Don't forget to start your server with the '+map dm2' command line
  98.   option.
  99.  
  100. ===========================================================================
  101. */
  102.  
  103. /*
  104. ========================================================================
  105.    EXAMPLE 2
  106. ========================================================================
  107.  
  108.   if      (                     nextmap == "end"  ) nextmap = "dm1"   ;
  109.   else if (mapname == "dm6"                       ) nextmap = "end"   ;
  110.   else if (mapname == "end"                       ) nextmap = "start" ;
  111.   else if (                     nextmap == "e1m1" ) nextmap = "e1m2"  ;
  112.   else if (mapname == "e1m3"                      ) nextmap = "e1m5"  ;
  113.   else if (mapname == "e1m7"                      ) nextmap = "e1m8"  ;
  114.   else if (mapname == "e1m8"                      ) nextmap = "start" ;
  115.   
  116.   What it does:
  117.  
  118.   Line 1: When Quake wants to play the level "end", we will go to level
  119.           "dm1" instead.
  120.   Line 2: When map "dm6" has ended, Quake usually wants to go to level
  121.           "dm1". But no, we prefer to branch to level "end".
  122.   Line 3: Quake proposes level "e1m1". No, it's ugly, we skip that one
  123.           and go to "e1m2" immediately.
  124.   Line 4: The map "e1m3" just ended. This level has two exits, branching
  125.           to "e1m8" and "e1m4".
  126.           No, we don't like "e1m4" in deathmatch and "e1m8" will be played
  127.           later, so we go to "e1m5" now.
  128.   Line 5: Level "e1m7" just ended and Quake wants to go back to the "start"
  129.           now. We override this and play the secret level "e1m8".
  130.   Line 6: After playing the secret level "e1m8", Quake wants us to play
  131.           "e1m5". However, we already visited this one earlier, so let's
  132.           go the the "start" level.
  133.  
  134. ===========================================================================
  135. */
  136.  
  137. /*
  138.   // EPISODE 1
  139.   else if (                     nextmap == "e1m1" ) nextmap = "e1m2"  ;
  140.   else if (mapname == "e1m3"                      ) nextmap = "e1m5"  ;
  141.   else if (mapname == "e1m7"                      ) nextmap = "e1m8"  ;
  142.   else if (mapname == "e1m8"                      ) nextmap = "start" ;
  143.  
  144.   // EPISODE 2
  145.   else if (                     nextmap == "e2m1" ) nextmap = "e2m7"  ;
  146.   else if (mapname == "e2m7"                      ) nextmap = "e2m1"  ;
  147.   else if (mapname == "e2m1"                      ) nextmap = "e2m2"  ;
  148.   else if (mapname == "e2m2"                      ) nextmap = "e2m3"  ;
  149.   else if (mapname == "e2m3"                      ) nextmap = "e2m4"  ;
  150.   else if (mapname == "e2m4"                      ) nextmap = "e2m5"  ;
  151.   else if (mapname == "e2m5"                      ) nextmap = "start" ;
  152.  
  153.   // EPISODE 3
  154.   else if (mapname == "e3m1"                      ) nextmap = "e3m5"  ;
  155.   else if (mapname == "e3m5"                      ) nextmap = "e3m6"  ;
  156.   else if (mapname == "e3m6"                      ) nextmap = "e3m7"  ;
  157.   else if (mapname == "e3m7"                      ) nextmap = "start" ;
  158.  
  159.   // EPISODE 4
  160.   else if (mapname == "e4m1"                      ) nextmap = "e4m8"  ;
  161.   else if (mapname == "e4m8"                      ) nextmap = "e4m2"  ;
  162.   else if (mapname == "e4m2"                      ) nextmap = "e4m3"  ;
  163.   else if (mapname == "e4m3"                      ) nextmap = "e4m4"  ;
  164.   else if (mapname == "e4m4"                      ) nextmap = "e4m6"  ;
  165.   else if (mapname == "e4m6"                      ) nextmap = "e4m7"  ;
  166.   else if (mapname == "e4m7"                      ) nextmap = "start" ;
  167. */
  168.  
  169.